public class demo0001 {
    // Synchronized
        public static void main(String[] args) {
            Phone phone = new Phone();
            new Thread(()->{
                phone.sms();
            },"A").start();
            new Thread(()->{
                phone.sms();
            },"B").start();
        }
    }
    class Phone{
        public synchronized void sms(){
            System.out.println(Thread.currentThread().getName() + "sms");
            call(); // 注意看这里，这里也有锁，直接调用了synchronized void call()
        }
        public synchronized void call(){
            System.out.println(Thread.currentThread().getName() + "call");
        }
}
